const path = require('path')
function resolve (dir) {
  return path.join(__dirname, dir)
}
module.exports = {
  publicPath: '',
  lintOnSave: true,
  chainWebpack: (config) => {
    config.resolve.alias
      .set('@assets', resolve('src/assets'))
      .set('@views', resolve('src/views'))
  },
  productionSourceMap: false, // 打包时不用生成map文件
  devServer: {
    proxy: {
      '/api': {
        // target: ' http://127.0.0.1:8888/', // 部署码云静态页面时打开
        target: 'http://123.57.203.170:8886', // 本地开发时打开
        changeOrigin: true,
        ws: true,
        pathRewrite: {
          '^/api': ''
        }
      }
    },
    port: 8080
  }
}
